//
//  YKPlace.m
//  yuke
//
//  Created by Dejun Liu on 15/1/8.
//  Copyright (c) 2015年 juwan. All rights reserved.
//

#import "YKPlace.h"

@implementation YKPlace

+ (NSArray *)listFromArrayDic:(NSArray *)arr
{
    NSMutableArray *res = [NSMutableArray array];
    if (![arr isKindOfClass:[NSNull class]]) {
        [arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            YKPlace *p = [[YKPlace alloc] init];
            p.name = [obj objectForKey:@"name"];
            p.pic = [obj objectForKey:@"pic"];
            p.cateid = [obj objectForKey:@"cateid"];
            p.subcateid = [obj objectForKey:@"subcateid"];
            [res addObject:p];
        }];
    }
    return res;
}

@end

@implementation YKLandmark

+ (NSArray *)listFromArrayDic:(NSArray *)arr
{
    NSMutableArray *res = [NSMutableArray array];
    if (![arr isKindOfClass:[NSNull class]]) {
        [arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
            YKLandmark *p = [[YKLandmark alloc] init];
            p.LMID = [NSString stringWithFormat:@"%@",[obj objectForKey:@"id"]];
            p.LMName = [NSString stringWithFormat:@"%@",[obj objectForKey:@"name"]];
            p.LMPic = [NSString stringWithFormat:@"%@",[obj objectForKey:@"pic"]];
            p.LMDes = [NSString stringWithFormat:@"%@",[obj objectForKey:@"des"]];
            p.LMStar = [NSString stringWithFormat:@"%@",[obj objectForKey:@"star"]];
            p.LMCommentNum = [NSString stringWithFormat:@"%@",[obj objectForKey:@"comment"]];
            p.LMBigClassId = [NSString stringWithFormat:@"%@",[obj objectForKey:@"cateid"]];
            p.LMSmallClassId = [NSString stringWithFormat:@"%@",[obj objectForKey:@"subcateid"]];
            p.LMPriceNow = [NSString stringWithFormat:@"%@",[obj objectForKey:@"pricenew"]];
            p.LMPricePre = [NSString stringWithFormat:@"%@",[obj objectForKey:@"price"]];
            [res addObject:p];
        }];
    }
    return res;
}

@end
